home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Mac Game Programming Gurus
/
TricksOfTheMacGameProgrammingGurus.iso
/
More Source
/
Libraries
/
SAT 2.3b4
/
Demo ƒ
/
SATminimal demo ƒ
/
SATminimal.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-01-16
|
1KB
|
43 lines
#include "SAT.h"
/* program SATminimal; */
/* MySprite's interface */
extern void InitMySprite();
extern pascal void SetupMySprite (SpritePtr);
extern pascal void HandleMySprite (SpritePtr);
main()
{
SpritePtr ignoreSp;
long L;
/* ThinkC and MWC don't initialize the toolbox automatically, so we ask SAT to do that. */
SATInitToolbox();
/* Initialize, using PICTs 128 or 129 as background, Classic-sized drawing area. */
SATInit(128, 129, 512, 322);
/* Initialize sprite unit(s), by preloading faces and sounds */
InitMySprite();
/* Make a few sprites */
ignoreSp = SATNewSprite(0, 50, 50, SetupMySprite);
ignoreSp = SATNewSprite(0, 100, 100, SetupMySprite);
ignoreSp = SATNewSprite(0, 125, 120, SetupMySprite);
ignoreSp = SATNewSprite(0, 150, 140, SetupMySprite);
ignoreSp = SATNewSprite(0, 200, 180, SetupMySprite);
ignoreSp = SATNewSprite(0, 250, 200, SetupMySprite);
ignoreSp = SATNewSprite(0, 300, 250, SetupMySprite);
/* Run until the user clicks the mouse button */
while (!Button())
{
L = TickCount();
SATRun(true); /* Run the animation */
while (L > TickCount() - 2L) /* Speed limit */
;
}
SATSoundShutup(); /* Always make sure the channel is de-allocated */
}